//
//  OptionLayer.h
//  Clicker Heroes
//
//  Created by Cloner Team on 11/2/14.
//
//

#ifndef OPTION_LAYER_H
#define OPTION_LAYER_H
#include "AbstractLayer.h"

class OptionLayer : public AbstractLayer {
    UG_PROPERTY_FULL(Layer*, mainLayer, MainLayer);
    UG_PROPERTY_FULL(ProgressTimer*, sfxBar, SfxBar);
    UG_PROPERTY_FULL(ProgressTimer*, bgmBar, BgmBar);
    UG_PROPERTY_FULL(MenuItemSprite*, resetButton, ResetButton);
private:
    bool isControlSfx;
    bool isControlBgm;
    Face* downSfxBar;
    Face* downBgmBar;
    Face* sfxControl;
    Face* bgmControl;
    GameModel* gameModel;
    SoundModel* soundModel;
    Face* optionBoard;
    UGLayerColor* grayLayer;
    virtual void onEnter();
    virtual void onExit();
    void onCloseOptionBoard(Ref* sender);
    void touchesRegister();
    void initialize();
    void createLayers();
    void createLayersContent();
    
    void onTouchesBegan(const std::vector<Touch*>& touches, Event* event);
    void onTouchesMoved(const std::vector<Touch*>& touches, Event* event);
    void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
public:
    OptionLayer();
    ~OptionLayer();
    virtual void update(float dt);
    CREATE_FUNC(OptionLayer);
};

#endif /* defined(__Clicker_Heroes__OptionLayer__) */
